<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.net.URLEncoder"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>毕业论文管理系统</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<link rel="shortcut icon"
	href="${pageContext.request.contextPath }/favicon.ico"
	type="${pageContext.request.contextPath }/image/x-icon" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/css/font.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/css/xadmin.css">
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery-3.3.1.min.js"></script>
<script src="${pageContext.request.contextPath }/lib/layui/layui.js"
	charset="utf-8"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/xadmin.js"></script>
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
	<br>
	<div class="x-body">
		<fieldset class="layui-elem-field">
			<legend>论文题目</legend>
			<div class="layui-field-box">
				<div style="height: 20px;"></div>
				<div class="layui-form-mid layui-word-aux"
					style="margin-left: 30px;">我的论文题目</div>
				<div class="layui-input-inline" style="width: 78%;">
					<input type="text" readonly name="title" value="${student.choose_topic.title }"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux"
					style="margin-right: 55px; float: right;">
					<p style="color: #1AA093;">${student.status }</p>
				</div>
				<div style="height: 20px;"></div>
			</div>
		</fieldset>
		<br />
		<fieldset class="layui-elem-field">
			<legend>我的论文</legend>
			<c:choose>
				<c:when test="${!empty thesisList }">
			<table class="layui-table" style="width: 96%; margin: 2%">
				<thead>
					<tr>
						<th>论文阶段</th>
						<th>下载论文</th>
						<th>论文标题</th>
						<th>修改内容</th>
						<th>老师建议</th>
				</thead>
				<tbody>
					<c:forEach items="${thesisList }" var="thesis">			
					<tr>
						<td>${thesis.stage }</td>
						<td>
							<a href="${pageContext.request.contextPath }/download.do?filename=${thesis.file_name}" class="layui-btn">
								<i class="icon iconfont">&#xe714;</i>&nbsp;&nbsp;下载论文
							</a>
						</td>
						<td><input type="text" name="title" value="${thesis.topic.title }"
							autocomplete="off" class="layui-input"></td>
						<td><button type="button" onclick="looks('${thesis.modify}')"
								class="layui-btn layui-btn-primary layui-btn-radius">查看</button></td>
						<td>
							<button type="button" onclick="looks('${thesis.suggest}')"
								class="layui-btn layui-btn-primary layui-btn-radius">查看</button>
						</td>
					</tr>
				</c:forEach>
				</tbody>
			</table>
			</c:when>
				<c:otherwise>
					你尚未发布论文
				</c:otherwise>
			</c:choose>
		</fieldset>
	</div>

</body>
<script>
	function downloads(file_name){
		$.ajax({
			url : "${pageContext.request.contextPath }/student/selectTopic.do",
			type : "post", 
			data : JSON.stringify({topic_id:topic_id,student_no:student_no}),//成功响应的结果
			success : function(data){
				if(data != null){					
					layer.msg(data.msg,{time:2000});
				}
			}
	  	}); 
	}
	function looks(s) {
		layer.open({
			type : 0,
			title : "查找用户角色",
			area : [ '40%', '40%' ],
			content : s
		});
	}
</script>
</html>